Overwrite the user exclude list when the client is branded.
authorCamila Ayres <hello@camilasan.com>
Mon, 27 Jan 2025 13:35:55 +0000 (14:35 +0100)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Tue, 11 Feb 2025 09:57:01 +0000 (10:57 +0100)
Enforce specific sync-exclude file to all users.

Signed-off-by: Camila Ayres <hello@camilasan.com>
src/libsync/configfile.cpp

index 93e9f2cbfa039a84dc30ca11a861588cb01125f1..b1cb4268d1059948c704f90fd426d1b8114beba7 100644 (file)
@@ -1271,6 +1271,12 @@ void ConfigFile::setupDefaultExcludeFilePaths(ExcludedFiles &excludedFiles)
     const auto userList = cfg.excludeFile(ConfigFile::UserScope);
     const auto legacyList = cfg.excludeFile(ConfigFile::LegacyScope);
 
+    if (Theme::instance()->isBranded() && QFile::exists(systemList) && QFile::copy(systemList, userList)) {
+        qCInfo(lcConfigFile) << "Overwriting user list" << userList << "with system list" << systemList;
+        excludedFiles.addExcludeFilePath(systemList);
+        return;
+    }
+
     if (!QFile::exists(userList)) {
         qCInfo(lcConfigFile) << "User defined ignore list does not exist:" << userList;